package com.example.biketask.dao;

import com.example.biketask.pojo.UserOperation;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

/**
 * 1-点击  2-缩放  3-拖拽
 */

@Mapper
public interface OptUserMapper {


    @Results(id = "Bt01Map", value = {
            @Result(property = "id", column = "id", jdbcType = JdbcType.INTEGER),
            @Result(property = "optType", column = "opt_type", jdbcType = JdbcType.INTEGER),
            @Result(property = "userIp", column = "user_ip", jdbcType = JdbcType.VARCHAR),
            @Result(property = "createTime", column = "create_time", jdbcType = JdbcType.DATE),
    })



    //保存用户记录
    @Insert("insert into bt_01(opt_type,user_ip,create_time) values(#{optType},#{userIp},#{createTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")    //该注解返回自增id
    void userOperation(UserOperation userOperation);

    //保存点击详情记录
    int clickOperation();
    //@Insert("insert into bt_02()")
}
